package com.company.service.impl;

import com.company.CompanyException;
import com.company.model.Feedback;
import com.company.model.request.FeedbackRequest;
import com.company.repository.FeedbackRepository;
import com.company.service.IFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by tu on 2017/6/1.
 */
@Service
public class FeedbackServiceImpl implements IFeedbackService {

  @Autowired
  FeedbackRepository repository;

  @Override
  public Feedback add(FeedbackRequest info, String userAgent) throws CompanyException {
    return repository.save(new Feedback(info, userAgent));
  }
}
